package sun.sequence.feign;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import sun.sequence.data.Result;

import java.util.List;

public interface SequenceNumFeign {

    @GetMapping("/inner/sequenceNum/genId")
    Result<Long> genId(@RequestParam("namespace") String namespace,
                       @RequestParam("bizTag") String bizTag);


    @GetMapping("/inner/sequenceNum/batchGenId")
    Result<List<Long>> batchGenId(@RequestParam("namespace") String namespace,
                                  @RequestParam("bizTag") String bizTag,
                                  @RequestParam("batchSize") Integer batchSize);


    @PostMapping("/inner/sequenceNum/initSequenceNum")
    Result<Object> initSequenceNum(@RequestParam("namespace") String namespace,
                                   @RequestParam("bizTag") String bizTag,
                                   @RequestParam("initVal") Long initVal,
                                   @RequestParam("step") Integer step,
                                   @RequestParam("description") String description);
}
